<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * Define the application's command schedule.
     */
    protected function schedule(Schedule $schedule): void
    {
        $schedule->command('download:expire')
            ->withoutOverlapping()
            ->onOneServer()
            ->dailyAt('00:10')
            ->runInBackground()
            ->description('每天凌晨0点10分标记下载中心过期数据');

        $schedule->command('video_clip_task:retry')->withoutOverlapping()->everyMinute()->runInBackground()->description('剪辑任务重试');
        $schedule->command('video_clip_task:long_time_running_mark_failed')->withoutOverlapping()->everyMinute()->runInBackground()->description('剪辑任务重试');
    }

    /**
     * Register the commands for the application.
     */
    protected function commands(): void
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}
